#include<stdio.h>
#include<unistd.h>
#include<stdlib.h>
#include<sys/types.h>
#include<sys/wait.h>
int main()
{
    pid_t id = fork();

    if(id == 0)
    {
        extern char** environ;
        putenv("PRIVATE_ENV=666666");
       // char* const myargv[] = {"ls","-a","-l",NULL};
        printf("before: I am a process, pid:%d,ppid:%d\n",getpid(),getppid());
      //  sleep(5);
      //  execlp("/usr/bin/ls","ls","-al",NULL);
      //  execlp("ls","ls","-al",NULL);
        //execv("/usr/bin/ls",myargv);
       // execvp("ls",myargv);
       // 
        //execl("/usr/bin/python3","python3","test.py",NULL);
        //execl("/usr/bin/bash","bash","test.sh",NULL);
       // char* const myargv[] = {"otherExe","-a","-b","-c",NULL};
       // execv("./otherExe", myargv);
       //
        char* const myenv[] = {"MY_VALUE=1111","MYPATH=/usr/bin/xxxx",NULL};
        execle("./otherExe","otherExe","-a","-b","-c",NULL,myenv);
        //execle("./otherExe","otherExe","-a","-b","-c",NULL,environ);
        printf("after: I am a process, pid:%d,ppid:%d\n",getpid(),getppid());
        exit(1);
    }
    pid_t ret = waitpid(id,NULL,0);
    if(ret > 0) 
    {
        printf("wait success,father pid : %d, ret id : %d\n",getpid(),ret);
    }
    sleep(5);
    return 0;
}
